/*
 <jFreeDrawer>
    Copyright (C) <2011>  <Jesus Hernandez Sevilla>

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.


 */
/*
 * VentanaInternaImagen.java
 *
 * Created on 9 de enero de 2008, 18:41
 */

package sm;

import javax.swing.*;
import java.awt.*;
import java.awt.image.*;
/**
 *
 * @author  djnano
 */
public class VentanaInternaImagen extends javax.swing.JInternalFrame {
    
    /**
     * Creates new form VentanaInternaImagen
     */
    VentanaPrincipal vp;
    
    public VentanaInternaImagen(String nombre, VentanaPrincipal parent) {
        super(nombre, true, true, true);
        vp = parent;
        this.setSize(600,600);
        initComponents();
    }
    
    public void setImage(BufferedImage img){
        ((Lienzo)panelInterno).setImageOriginal(img);
    }
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
    private void initComponents() {
        jScrollBar1 = new javax.swing.JScrollBar();
        scrollInterno = new javax.swing.JScrollPane();
        panelInterno = new Lienzo(vp);
        panelInterno.setBackground(Color.LIGHT_GRAY);

        scrollInterno.setMinimumSize(new java.awt.Dimension(200, 200));
        org.jdesktop.layout.GroupLayout panelInternoLayout = new org.jdesktop.layout.GroupLayout(panelInterno);
        panelInterno.setLayout(panelInternoLayout);
        panelInternoLayout.setHorizontalGroup(
            panelInternoLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(0, 398, Short.MAX_VALUE)
        );
        panelInternoLayout.setVerticalGroup(
            panelInternoLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(0, 263, Short.MAX_VALUE)
        );
        scrollInterno.setViewportView(panelInterno);

        getContentPane().add(scrollInterno, java.awt.BorderLayout.CENTER);

        pack();
    }// </editor-fold>//GEN-END:initComponents
    
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JScrollBar jScrollBar1;
    public javax.swing.JPanel panelInterno;
    private javax.swing.JScrollPane scrollInterno;
    // End of variables declaration//GEN-END:variables

    
}
